<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"
>

<!-- 导入公有的header -->
<head th:include="common/head::header"/>


<body class="hold-transition skin-blue sidebar-mini">
    <!-- =============================================== -->
    <!-- Main content -->
    <section class="content">

        <div class="row">
            <div class="col-md-12">


                        <!-- radio -->
                        <div class="form-group">
                            <label>
                                <input type="radio" name="musicPlayerType"  value="ALL" th:checked="${vlcIsRun==false}">
                                通用类型
                            </label>
                            <label th:if="${IS_MAC_OS==true}">
                                <input type="radio" name="musicPlayerType"  value="MAC_VLC" th:checked="${vlcIsRun==true}">
                                MAC系统的VLC播放器
                            </label>
                            <label th:if="${IS_WIN_OS==true}">
                                <input type="radio" name="musicPlayerType"  value="WIN_FOOBAR2000">
                                Windows Foobar2000
                            </label>
                            <label th:if="${IS_WIN_OS==true}">
                                <input type="radio" name="musicPlayerType" value="WIN_POT_PLAYER">
                                Windows 完美解码
                            </label>
                        </div>


                <Irca:ircaButton text="播放/暂停" onclick="playOrStop();" ico="fa  fa-play" continuity="false" class="btn btn-block btn-success btn-lg"></Irca:ircaButton>


                <Irca:ircaButton text="静音/有声" onclick="playerMuteReduce();" keyword="M" ico="fa  fa-bell-slash-o" continuity="false" class="btn btn-block btn-primary btn-lg"></Irca:ircaButton>


                <Irca:ircaButton text="播放器音量" onclick="playerVolumeReduce();" ico="fa fa-volume-down" continuity="false" class="btn btn-block btn-primary btn-lg"></Irca:ircaButton>

                <Irca:ircaButton text="播放器音量" onclick="playerVolumeAdd();" ico="fa fa-volume-up" continuity="false" class="btn btn-block btn-primary btn-lg"></Irca:ircaButton>


                <Irca:ircaButton text="快退" onclick="speedReduce();" ico="fa  fa-angle-double-left" continuity="true" class="btn btn-block btn-primary btn-lg"></Irca:ircaButton>

                <Irca:ircaButton text="快进" onclick="speedAdd();" ico="fa  fa-angle-double-right" continuity="true" class="btn btn-block btn-primary btn-lg"></Irca:ircaButton>

                <Irca:ircaButton text="上一个" onclick="previous();" ico="fa fa-arrow-left" continuity="false" class="btn btn-block btn-primary btn-lg"></Irca:ircaButton>

                <Irca:ircaButton text="下一个" onclick="next();" ico="fa fa-arrow-right" continuity="false" class="btn btn-block btn-primary btn-lg"></Irca:ircaButton>

                <Irca:ircaButton text="退出播放程序" onclick="exitPlayer();" ico="fa fa-power-off" continuity="false" class="btn btn-block btn-danger btn-lg"></Irca:ircaButton>


            </div>
            <!-- /.col -->
        </div>

    </section>
    <!-- /.content -->
    <script type="application/javascript">
        //播放，暂停
        function playOrStop(){
            parent.sendMusicCmd('PLAY_STOP_CMD','-1',getMusicPlayerTypeSelect());
        }
        //快进
        function speedAdd(){
            parent.sendMusicCmd('SPEED_ADD_CMD','-1',getMusicPlayerTypeSelect());
        }
        //快退
        function speedReduce(){
            parent.sendMusicCmd('SPEED_REDUCE_CMD','-1',getMusicPlayerTypeSelect());
        }
        //播放器的音量+
        function playerVolumeAdd(){
            parent.sendMusicCmd('PLAYER_VOLUME_ADD_CMD','-1',getMusicPlayerTypeSelect());
        }
        //播放器的音量-
        function playerVolumeReduce(){
            parent.sendMusicCmd('PLAYER_VOLUME_REDUCE_CMD','-1',getMusicPlayerTypeSelect());
        }
        //静音与解除静音
        function playerMuteReduce(){
            parent.sendMusicCmd('MUTE_CMD','-1',getMusicPlayerTypeSelect());
        }
        //下一个
        function next(){
            parent.sendMusicCmd('NEXT_CMD','-1',getMusicPlayerTypeSelect());
        }
        //上一个
        function previous(){
            parent.sendMusicCmd('PREVIOUS_CMD','-1',getMusicPlayerTypeSelect());
        }
        //退出播放器
        function exitPlayer(){
            parent.sendMusicCmd('EXIT_PLAYER_CMD','-1',getMusicPlayerTypeSelect());
        }
        /**
         * 获取播放器被选中的类型
         * @returns {*|define.amd.jQuery}
         */
        function  getMusicPlayerTypeSelect(){
            return $("input[name='musicPlayerType']:checked").val();
        }
    </script>
</body>
</html>
